package com.TestDemo.Test2;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

public class TestClassNewObject {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {



        Class<?> aClass = Class.forName("com.TestDemo.Test2.TestClassNewObject");

        System.out.println(aClass.getName());

        Constructor<?> constructor = aClass.getConstructor(TestClassNewObject.class);

        TestClassNewObject o = (TestClassNewObject)constructor.newInstance();

        o.a();




    }


    public static void a(){
        System.out.println("a");
    }
}
